﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Zhao.Common.Helper;
using Zhao.IServer.Field;

namespace Zhao.Arena.MiniProgram.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class FieldTypesController : ControllerBase
    {
        private readonly IFieldTypesServer _fieldTypesServer;

        public FieldTypesController(IFieldTypesServer fieldTypesServer)
        {
            _fieldTypesServer = fieldTypesServer;
        }


        /// <summary>
        /// 获取下拉框的值直接返回数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<JsonResult> Dropdowns() =>new JsonResult(await _fieldTypesServer.GetDictionariesAsync()) ;

    }
}
